package cn.jtcoding.user.mapper;


import cn.jtcoding.user.pojo.dataobject.UserAddressDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserAddressMapper {

    UserAddressDO queryUserAddress(@Param("userId") String userId, @Param("addressId") String addressId);

    UserAddressDO queryDefaultAddress(String userId);

    int updateAddressToBeDefault(@Param("userId") String userId, @Param("addressId") String addressId);

    int deleteUserAddress(String userId, String addressId);

    int updateUserAddress(UserAddressDO address);

    boolean existsDefaultAddress(String userId);

    int addUserAddress(UserAddressDO address);

    List<UserAddressDO> listUserAddress(String userId);
}